package com.zhanggm.springcloud.consul.controller;

import com.zhanggm.springcloud.consul.config.ConfigInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RefreshScope
@RestController
public class TestController {

    @Value("${config.info}")
    private String configInfo;

    @Autowired
    private ConfigInfo config;

    @RequestMapping("test")
    public Object test(){
        log.info("config.info:{}",config.getInfo());
        return config;
    }
}
